#ifndef WOLF_EVENT_HANDLER_HPP
#define WOLF_EVENT_HANDLER_HPP

#include "common.hpp"
namespace wolf {
class Engine;
/**
 * @brief Abstract Event handler
 * @ingroup engineMod
 *
 * This class handles events on the system.
 * It is made to switch the old handler API which is deprecated.
 **/
class WOLF_DECLSPEC Manager {
public:
	/**
	 * @brief virtual destructor
	 *
	 * It just ensure that the handler was removed from engine.
	 **/
	virtual ~Manager(void);

	/**
	 * @brief Occurs when a event is caught by the engine
	 *
	 * @param engine the current running engine;
	 * @param event the SDL_Event which was caught.
	 * @return true if the event should be fowarded to others handlers;
	 **/
	virtual bool onEvent(Engine &engine, SDL_Event &event) {
		return true;
	}

	/**
	 * @brief Occurs when the game try to be quit
	 *
	 * @param engine the SDL_Event which was caught.
	 * @return true if the engine is allowed to quit.
	 **/
	virtual bool onQuit(Engine &engine) {
		return true;
	}

	/**
	 * @brief Occurs every frame, when the screen is redrawn
	 *
	 *
	 * @param engine the SDL_Event which was caught.
	 * @param dst The screen.
	 **/
	virtual void onDraw(Engine &engine, SDL_Surface *dst) {
	}

	/**
	 * @brief Occurs every frame
	 *
	 * Happens after any onEvent() and before the onDraw()
	 * @param engine the SDL_Event which was caught.
	 **/
	virtual void onFrame(Engine &engine) {
	}

	/**
	 * @brief Like onFrame, executed before event handling
	 *
	 * Happens before any onEvent().
	 * @param engine the SDL_Event which was caught.
	 **/
	virtual void onStartFrame(Engine &engine) {
	}

	/**
	 * @brief Occurs when the handler is added.
	 * @brief engine the engine.
	 */
	virtual void onSetup(Engine &engine) {
	}

	/**
	 * @brief Occurs when the handler is removed.
	 * @brief engine the engine.
	 */
	virtual void onCleanup(Engine &engine) {
	}
protected:

	/**
	 * @brief A empty constructor just to make sure it is abstract
	 *
	 *
	 **/
	Manager(void) {
	}

};

}

#endif // WOLF_EVENT_HANDLER_HPP
